| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1.008 |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | /** |
||
| 7 | 2 | const setup = (setTitle, setPrefix, setSuffix, { router }) => { |
|
| 8 | 1 | router.afterEach((to, from) => { |
|
| 9 | 2 | const { meta } = to |
|
| 10 | |||
| 11 | // if has meta |
||
| 12 | 2 | if (meta) { |
|
| 13 | // if has title |
||
| 14 | 2 | if (meta.title) { |
|
| 15 | 1 | setTitle(meta.title) |
|
| 16 | } |
||
| 17 | |||
| 18 | // if has titlePrefix |
||
| 19 | 2 | if (meta.titlePrefix) { |
|
| 20 | setPrefix(meta.titlePrefix) |
||
| 21 | } |
||
| 22 | |||
| 23 | // if has titleSuffix |
||
| 24 | 2 | if (meta.titleSuffix) { |
|
| 25 | setSuffix(meta.titleSuffix) |
||
| 26 | } |
||
| 27 | } |
||
| 28 | }) |
||
| 29 | } |
||
| 30 | |||
| 32 |